home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / text / hp540_fw.lzh / PrintEnvelope.public
Text File  |  1995-09-08  |  3KB  |  66 lines

  1. /* filename: PrintEnvelope                                                  */
  2. /*  version: 1.0      8 Sep 95                                              */
  3. /*                                                                          */
  4. /*  purpose: FinalWriter macro to print a return and recipient address on a */
  5. /*           single-fed envelope on an HP540 (5xx/6xx series) printer       */
  6. /*                                                                          */
  7. /*   syntax: called from within FinalWriter                                 */
  8. /*                                                                          */
  9. /*   author: Jim Dutton                                                     */
  10. /*           jimd@slip106.termserv.siu.edu                                  */
  11. /*           ca0008@siucvmb.siu.edu                                         */
  12. /*                                                                          */
  13. /*  prereqs: ENV:FW/MyName, ENV:FW/MyAddress, ENV:FW/MyCityStateZip         */
  14. /*                                                                          */
  15. /*    usage: set the prerequisite Environment variables with your desired   */
  16. /*           return address (it is assumed that only 3 lines are needed)    */
  17. /*                                                                          */
  18. /*           create FW document WITH recipient address as part of the text, */
  19. /*           in the format of a mailing address (ie; seperate lines)        */
  20. /*                                                                          */
  21. /*           highlight the recipient address text and invoke this macro     */
  22. /*                                                                          */
  23. /* comments: the UNIVERS font is preselected - the envelope print setup is  */
  24. /*           predetermined by the printer - only use envelopes that your    */
  25. /*           printer supports - the "EXTRACT" comment obtains the recipient */
  26. /*           address data from FinalWriter                                  */
  27.  
  28. Options Results
  29.  
  30. If ~open(hp540,'PAR:')  then
  31.   Do; say '** Unable to open PARallel port **'; Exit 32; End
  32.  
  33. If ~open(envname,"ENV:FW/MyName")  then
  34.   Do; say '** Unable to open ENV:FW/MyName **"; Exit 33; End
  35. myname = strip(readln(envname)); duh = close(envname)
  36.  
  37. If ~open(envaddr,"ENV:FW/MyAddress")  then
  38.   Do; say '** Unable to open ENV:FW/MyAddress **'; Exit 34; End
  39. myaddress = strip(readln(envaddr)); duh = close(envaddr)
  40.  
  41. If ~open(envstate,"ENV:FW/MyCityStateZip")  then
  42.   Do; say '** Unable to open ENV:FW/MyCityStateZip **; Exit 35; End
  43. myCityStateZip = strip(readln(envstate)); duh = close(envstate)
  44.  
  45. esc = '1B'x; reset = esc || "E"; line_termination = esc || "&k3G"
  46. univers = esc || "(s1p12v0s0b52T"
  47. paper_size.envelope = esc || "&l81A"
  48. EnvelopeFeed = esc || "&l3H"
  49. LeftMargin50_Skip8Rows = esc || "&a50l&a+8R"
  50.  
  51. duh = writeln(hp540,line_termination)
  52. duh = writech(hp540,univers)
  53. duh = writech(hp540,paper_size.envelope)
  54. duh = writeln(hp540,EnvelopeFeed)
  55.  
  56. duh = writeln(hp540,myname);  duh = writeln(hp540,myaddress)
  57. duh = writeln(hp540,myCityStateZip)
  58.  
  59. duh = writeln(hp540,LeftMargin50_Skip8Rows)
  60.  
  61. "Extract"
  62. duh = writech(hp540,Result)
  63.  
  64. duh = writeln(hp540,reset);  duh = close(hp540)
  65. Exit
  66.